package ca.usherbrooke.domus.sipnmove.sip;

/**
 * Facade over Jain-SIP API
 * 
 * Jain-SIP is a complicated API for SIP connectivity in Java, but it is quite complicated to manage, 
 * that is why we have created a simpler SIP interface.
 */
public interface SipFacade {

	/**
	 * Add SIP facade listener
	 * 
	 * SIP CallId are used to redirect request and response to target calls
	 * 
	 * @param callId 
	 * @param sipFacadeListener Listener of the facade
	 */
	public void addSipFacadeListener(String callId, SipFacadeListener sipFacadeListener);

	/**
	 * Generate a valid unique SIP CallId
	 * @return callId
	 */
	public String generateCallId();

	/**
	 * Return the SIP user information
	 * @return SIP user information
	 */
	public SipUserInformation getSipUserInformation();

	/**
	 * Send an INVITE SIP message
	 * @param toAdressString Destination address
	 * @param callId SIP CallId
	 */
	public void sendInvite(String toAdressString, String callId);

	/**
	 * Send a RINGING SIP message
	 * 
	 * TODO : Define the parameters of this method
	 */
	public void sendRinging();

	/**
	 * Send an OK SIP message
	 * 
	 * TODO : Define the parameters of this method
	 */
	public void sendOk(/*RequestEvent requestEvent, ServerTransaction serverTransaction, SipUserInformation userInfos*/);
	
	/**
	 * Send an ACK SIP message
	 * 
	 * TODO : Define the parameters of this method
	 */
	public void sendAck();

	/**
	 * Send a BYE SIP message
	 * 
	 * TODO : Define the parameters of this method
	 */
	public void sendBye();

	/**
	 * Remove SIP facade listener
	 * 
	 * @param callId 
	 */
	public void removeSipFacadeListener(String callId);

	/**
	 * Define which SipFacadeListener should be prevented of incoming message that 
	 * correspond to unknown CallId
	 *  
	 * @param sipFacadeListener Listener of the facade
	 */
	public void setUnknownCallSipFacadeListener(SipFacadeListener sipFacadeListener);

}
